package com.antler.luajavalibrary.luaext.utils;

import android.util.DisplayMetrics;
import android.util.Size;

import com.antler.luajavalibrary.application.MyApplication;

public class ScreenUtils {
    private final static String TAG = "antler_" + ScreenUtils.class.getSimpleName();

    private ScreenUtils() {
        throw new AssertionError();
    }

    public static Size getSize() {
        Size size = null;
        DisplayMetrics metrics = MyApplication.getContext().getResources().getDisplayMetrics();
        if (metrics != null) {
            size = new Size(metrics.widthPixels, metrics.heightPixels);
        }
        return size;
    }

    public static int getDPI() {
        int DPI = -1;
        DisplayMetrics metrics = MyApplication.getContext().getResources().getDisplayMetrics();
        if (metrics != null) {
            DPI = metrics.densityDpi;
        }
        return DPI;
    }
}
